import com.example.test1.Triangle;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvFileSource;
import org.junit.jupiter.params.provider.CsvSource;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class TriangleTest2 {
    Triangle triangle = new Triangle();

    @ParameterizedTest
    @
            CsvSource({
            "1,2,3,非三角形",
            "-1,2,3,输入错误"
    })
    void testWithCsvSource(int a,int b,int c,String expected) {
        assertEquals(expected, triangle.classify(a,b,c));
    }

    @DisplayName(" 一般边界值方法")
    @ParameterizedTest
    @CsvFileSource(resources = "\\UseCaseOne.csv")
    void test_csv_file_source1(int a, int b, int c, String expected) {
        assertEquals(expected, triangle.classify(a,b,c));
    }

    @DisplayName("健壮性边界值方法")
    @ParameterizedTest
    @CsvFileSource(resources = "\\UseCaseTwo.csv")
    void test_csv_file_source2(int a, int b, int c, String expected) {
        assertEquals(expected, triangle.classify(a,b,c));
    }

    @DisplayName("最坏情况一般边界值分析方法")
    @ParameterizedTest
    @CsvFileSource(resources = "\\UseCaseThree.csv")
    void test_csv_file_source3(int a, int b, int c, String expected) {
        assertEquals(expected, triangle.classify(a,b,c));
    }
    @DisplayName("最坏情况健壮性边界值分析方法")
    @ParameterizedTest
    @CsvFileSource(resources = "\\UseCaseFour.csv")
    void test_csv_file_source4(int a, int b, int c, String expected) {
        assertEquals(expected, triangle.classify(a,b,c));
    }
}
